﻿using System;
using System.Data;

namespace CuaHangMayTinh.PresentationLayer
{
    public interface IFormTV <T>
    {
        /// <summary>
        /// lấy thông tin lên list view
        /// </summary>
        void LoadListView();

        /// <summary>
        /// lấy thông tin lên list view từ datatable
        /// </summary>
        void LoadListView(DataTable dt);

        /// <summary>
        /// bắt sự kiện thêm click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_them_click(object sender, EventArgs e);

        /// <summary>
        ///  bắt sự kiện xoa click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_xoa_click(object sender, EventArgs e);

        /// <summary>
        ///  bắt sự kiện sửa click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_sua_click(object sender, EventArgs e);

        /// <summary>
        ///  bắt sự kiện tìm kiếm click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_timkiem_click(object sender, EventArgs e);
    }

    public interface IFormThemTV<T>
    {
        void btn_themmoi_click(object sender, EventArgs e);

        void btn_xoatrang_click(object sender, EventArgs e);

        /// <summary>
        /// lấy từ form thành entity xuống
        /// </summary>
        /// <returns></returns>
        T GetEntity();

        /// <summary>
        /// load entity lên form
        /// </summary>
        /// <param name="entity"></param>
        void SetEntity(T entity);

        void XoaTrang();

        bool CheckInput();
    }
}
